<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.luntan.school.service.Posts" %>

<%@ page import="java.util.List" %>
<%@ page import="com.luntan.school.dao.PostsDao" %>
<%@ page import="com.luntan.school.dao.impl.PostsDaoImpl" %><%--
  Created by IntelliJ IDEA.
  User: chimei666
  Date: 2023/12/24
  Time: 19:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    PostsDao postsDao = new PostsDaoImpl();
    List<Posts> hotPosts = postsDao.getHotPosts();
    pageContext.setAttribute("hotPosts", hotPosts);
%>
<style>
    .title{
        color: #4CAF50;
        font-size: 0.5em;
    }
    .desc{
        font-size: 0.4em;
        font-weight: bold;
    }
</style>

<div class="right-sidebar">
    <h2>校园热点</h2>
    <ul class="sidebar-post-list">
        <c:forEach items="${hotPosts}" var="posts">
            <div class="item">
                <a  class="title" href="postdetail.jsp?id=${posts.id}">${posts.title}</a>
                <div class="desc">${posts.clickCount}阅读　${posts.commentNum}评论</div>
                <hr>
            </div>
        </c:forEach>
<%--        <li><a href="#">【招募】北京大学乡村振兴研究院招募专著写作助研 1</a></li>--%>
<%--        <li><a href="#">【招募】11.26一杯心茶：茶话生涯 2</a></li>--%>
        <!-- <li><a href="#">【招募】北大全健院 OneHealthAtlas志愿者招募 3</a></li>
      <li><a href="#">【招募】北大官方医疗AI会议，限时免费报名 4</a></li>
      <li><a href="#">【助研招募】乡村振兴研究院著作助研 5</a></li> -->
    </ul>
    <hr style="margin: 10px 0 10px 0;">
    <ul class="sidebar-post-list">
        <li style="font-weight: bold;"><a href="#">失物招领 身份证和各类卡</a></li>
        <li><a href="#">【寻物】Apple AirPods Pro</a></li>
        <!-- <li><a href="#">【寻物】罗技M590</a></li>
      <li><a href="#">【寻物】airpods第三代耳机</a></li>
      <li><a href="#">【寻物】未拆封蓝色运</a></li> -->
    </ul>
    <hr style="margin: 10px 0 10px 0;">
    <div class="connect">
        <p>联系我们</p>

        <div class="connect-pic">
            <img src="img/logo.png">
            <a href="#"><span>点此处或扫描二维码关注</span></a>
        </div>
        <div class="connect-title">

        </div>

        <div class="connect-body">
            <img src="img/ma.png">
        </div>

        <div class="connect-pic">
            <img src="img/logo.png">
            <a href="#"><span>点此处或扫描二维码关注</span></a>
        </div>
        <div class="connect-title">

        </div>

        <div class="connect-body">
            <img src="img/ma.png">
        </div>

        <div class="connect-pic">
            <img src="img/logo.png">
            <a href="#"><span>点此处或扫描二维码关注</span></a>
        </div>
        <div class="connect-title">

        </div>

        <div class="connect-body">
            <img src="img/ma.png">
        </div>


    </div>



</div>
